home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c-part2 / 13995 < prev    next >
Encoding:
Text File  |  1996-08-05  |  1.6 KB  |  36 lines

  1. Newsgroups: comp.lang.c
  2. Path: uu4news.netcom.com!telesoft!kst
  3. From: kst@thomsoft.com (Keith Thompson)
  4. Subject: Re: ANSI C and POSIX (was Re: C/C++ knocks the crap out of Ada)
  5. X-Nntp-Posting-Host: pulsar
  6. Message-ID: <Dponz7.2C4@thomsoft.com>
  7. Originator: kst@pulsar
  8. Sender: news@thomsoft.com (USENET News Admin @flash)
  9. Organization: Thomson Software Products, San Diego, CA, USA
  10. References: <dewar.828846122@schonberg> <828903511snz@genesis.demon.co.uk> <4kgjrc$4d@news.nyu.edu>
  11. Date: Thu, 11 Apr 1996 05:45:06 GMT
  12.  
  13. I've trimmed the "Newsgroups:" line down to comp.lang.c.
  14.  
  15. In <4kgjrc$4d@news.nyu.edu> halvin@acf4.nyu.edu (halvin) writes:
  16. [...]
  17. > this might be slightly off-topic, but isn't there a difference between the
  18. > ANSI and POSIX versions of fprintf? if i remember correctly, the ANSI version
  19. > returns 0 on success and EOF on failure -- but the POSIX version returns the
  20. > number of characters printed, or a negative number to indicate failure.
  21.  
  22. No, the ANSI/ISO C standard says that fprintf returns "the number of
  23. characters transmitted, or a negative value if an output error occurred."
  24. (7.9.6.1).  The POSIX specification is the same, at least according to the
  25. POSIX reference I have (I don't have a copy of the POSIX standard itself).
  26.  
  27. Perhaps you're thinking of sprintf, which returns char* in some
  28. implementations; however, POSIX and ANSI/ISO agree that sprintf returns
  29. int.
  30.  
  31. -- 
  32. Keith Thompson (The_Other_Keith) kst@thomsoft.com <*>
  33. TeleSoft^H^H^H^H^H^H^H^H Alsys^H^H^H^H^H Thomson Software Products
  34. 10251 Vista Sorrento Parkway, Suite 300, San Diego, CA, USA, 92121-2718
  35. This sig uses the word "Exon" in violation of the Communications Decency Act.
  36.